package PTA;

import java.util.Arrays;
import java.util.Scanner;

public class Pta11 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        double[][] arr = new double[n][n + 1];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n + 1; j++) {
                arr[i][j] = scanner.nextDouble();
            }
        }
        System.out.println(Arrays.deepToString(arr));
        for (int i = 0; i < n; i++) {
            StringBuilder str = new StringBuilder();
            for (int j = 0; j < n; j++) {
                str.append(arr[i][j]).append(", ");
            }
            str.delete(str.length() - 2, str.length());
            str.append(" = ").append(arr[i][n]);
            System.out.println(str);
        }
    }


}
